package com.mengxuegu.rbac.controller;

import com.mengxuegu.common.base.result.MengxueguResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;
import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/sysUser")
@Api(tags = "SysUserController")
public class SysUserController {

    @GetMapping("/list")
    //@PreAuthorize("hasAuthority('sys:product:list')")
    @ApiOperation(value = "查询列表")
    public MengxueguResult list(Principal principal) {
        List<String> list = new ArrayList<>();
        list.add("眼镜");
        list.add("格子衬衣");
        list.add("双肩包");
        list.add(principal.getName());
        return MengxueguResult.ok(list);
    }
}
